
$(document).ready(function() {
    var searchvalue = "搜索";
    var objt = $('.prettysearch');
    var objl = $('.reset');
    setSearchPretty(objt, objl, searchvalue);
});

//设置注册文本特效
function setprettytext(obj,objvalue)
{
	obj.val(objvalue);
	obj.focus(function(){if(this.value==objvalue){this.style.color="#CCCCCC";}})
	obj.blur(function(){if(this.value==""){this.value=objvalue;}if(this.value==objvalue){this.style.color="#333333";}})
	obj.keyup(function(){if(this.value==objvalue){this.value="";}else{this.style.color="#333333";}})
	obj.keydown(function(){if(this.value==objvalue){this.value="";}else{this.style.color="#333333";}})
}
//设置search文本特效
function setSearchPretty(objT,objL,objvalue)
{
	objT.val(objvalue);
	objT.focus(function(){if(this.value==objvalue){this.style.color="#000";this.value = "";}})
	objT.blur(function(){if(this.value==""){this.style.color = "#7e7e7e";this.value = objvalue;}})
	objT.keyup(function(){if(this.value!=objvalue && this.value!=""){objL.show();}else{objL.hide();}})
	$('.reset').click(function(){objT.val("");objL.hide();objT.focus();})
}
//设置table特效
function tablecss(objth,objcss)
{
    objcss.click(function() {
        var classname = objcss.attr("class");
        var ascening = classname.indexOf('ascending');
        var descending = classname.indexOf('descending');
        if (ascening <= 0 || descending > 0) {
            objth.removeClass("ascending");
            objth.removeClass("descending");
            objcss.addClass("ascending");
        } if (ascening > 0) {
              objth.removeClass("ascending");
              objth.removeClass("descending"); objcss.addClass("descending");
          }
    });
}